From 38651997ed10ad12c9dc9aebe04217fd0dd76bb6 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 5 Feb 2009 12:14:09 +0000 Subject: [PATCH] x86: recover pat value for bsp after S3 resume. host pat is set to cover all memory types by Xen, which is necessary to support guest mtrr/pat, especially when device is passthroughed with VT-d. However pat on bsp is not=20 recovered which could make assigned device defunct after S3 resume Signed-off-by Kevin Tian --- xen/arch/x86/acpi/suspend.c | 3 +++ xen/include/asm-x86/processor.h | 1 + 2 files changed, 4 insertions(+) diff --git a/xen/arch/x86/acpi/suspend.c b/xen/arch/x86/acpi/suspend.c index 3068590f70..e8a39fc6bc 100644 --- a/xen/arch/x86/acpi/suspend.c +++ b/xen/arch/x86/acpi/suspend.c @@ -65,6 +65,9 @@ void restore_rest_processor_state(void) /* Reload FPU state on next FPU use. */ stts(); + if (cpu_has_pat) + wrmsrl(MSR_IA32_CR_PAT, host_pat); + mtrr_ap_init(); mcheck_init(&boot_cpu_data); } diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h index d9af37aba2..996734d285 100644 --- a/xen/include/asm-x86/processor.h +++ b/xen/include/asm-x86/processor.h @@ -188,6 +188,7 @@ extern struct cpuinfo_x86 cpu_data[]; #define current_cpu_data boot_cpu_data #endif +extern u64 host_pat; extern int phys_proc_id[NR_CPUS]; extern int cpu_core_id[NR_CPUS]; -- 2.30.2